<template>
  <div class="app-container">
    <eHeader v-if="warehouseData.id !== ''" :param-bean="paramBean" :sup_this="sup_this" />
    <eForm ref="form" :sup_this="sup_this" />
    <PrintBarcodePage ref="printBarcodePage" :sup_this="sup_this" barcode-print-type="EAN-13" />
    <!--表格渲染-->
    <DataGridTable
      ref="mainTable"
      :sup_this="sup_this"
      :data="data.rtnList"
      :total="total"
      :max-height="gridMaxHeight"
      grid-id="storageLocationMngProcessGridId"
      @selection-change="handleGridSelectionChange">
      <el-table-column prop="slName" label="库位名称" >
        <template slot-scope="scope">
          <edit :data="scope.row" :sup_this="sup_this" />
        </template>
      </el-table-column>
      <el-table-column prop="id" label="库位条码" />
      <el-table-column prop="thirdCode" label="编号" />
    </DataGridTable>
  </div>
</template>

<script>
import checkPermission from '@/utils/permission'
import { parseTime } from '@/utils/index'
import eHeader from './module/header'
import edit from './module/edit'
import eForm from './module/form'
import initData from '@/mixins/initData'
import { loadDataUrl } from '@/api/base/storageLocation'
import PrintBarcodePage from '@/views/components/PrintBarcodePage'

export default {
  components: { eHeader, eForm, edit, PrintBarcodePage },
  mixins: [initData],
  // 设置数据字典
  data() {
    return {
      delLoading: false,
      sup_this: this,
      warehouseData: {
        id: ''
      }
    }
  },
  created() {
    this.url = loadDataUrl()
  },
  beforeDestroy() {
  },
  methods: {
    parseTime,
    checkPermission,
    async beforeInit() {
      this.data.rtnList = []
      if (!this.warehouseData) {
        return false
      }
      this.paramBean = { warehouseId: this.warehouseData.id }
      return true
    }
  }
}
</script>
